/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package ru.jSkyRoom.finder;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import ru.jSkyRoom.interfaces.major.Major;
import skyproc.FormID;

/**
 *
 * @author Rakev
 */
public abstract class AbstractFinderByFormId<T extends Major> implements FinderByFormId<T> {

    @Override
    public Collection<T> findMany(FormID... ids) {
        List<T> result = new ArrayList<>(ids.length);
        for (FormID id : ids) {
            result.add(find(id));
        }
        return result;
    }

    @Override
    public Collection<T> find(Collection<FormID> ids) {
        List<T> result = new ArrayList<>(ids.size());
        for (FormID id : ids) {
            result.add(find(id));
        }
        return result;
    }

}
